import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
	// 首页
    path: '/',
    name: '',
    component: Home,
	children:[
		{
			path: '/',
			// 重定向
			redirect: 'recommend',
		},
		{
			path: 'recommend',
			name: 'recommend',
			meta: '推荐',
			component: () => import('../views/recommend.vue'),
			children:[
			  {
				// 歌单广场
				path:'songplaza',
				name:'songplaza',
				meta:'歌单广场',
				component: () => import('../views/songPlaza.vue'),
			  },
			  {
				// 更多新碟
				path:'moresong',
				name:'moresong',
				meta:'更多新碟',
				component: () => import('../views/moreSong.vue'),
			  }
			]
		},
		{
			path: '/rank',
			name: 'rank',
			meta: '排行榜',
			component: () => import('../views/rank.vue')
		},
		{
			// 搜索
			path: '/search',
			name: 'search',
			meta: '搜索',
			component: () => import('../views/search.vue')
		},
	]
  },
	{
	// 专辑列表详情页,需要专辑ID
		path: '/list',
		name: 'list',
		component: () => import('../views/List.vue')
	}
]

const router = new VueRouter({
  routes
})

export default router
